﻿<%@ Page Title="编辑系统用户" Language="C#" MasterPageFile="~/Web/Main.Master"  AutoEventWireup="true" CodeBehind="sysAddUser.aspx.cs" Inherits="BOMS.WebUI.sysAddUser" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="/Js/Dialog.js"></script>
<script type="text/javascript">
    function dialogReturn(retval) {
        var dialog = top.Dialog.getInstance('Diag2');
        dialog.addParam("returnValue", retval);
        if (retval == "true") {
            alert("保存成功！");
        } else if (retval == "false") {
            alert("保存失败！");
        }        
        //else if (retval == "cancel")
        dialog.CancelButton.onclick();
    }
    function orgOpen(userId) {
        var Url= "sysDepartmentTree.aspx?userId=" + userId;

        //调用div弹出窗口
        var diag = new Dialog("Diag3");
        diag.Width = 540;
        diag.Height = 480;
        diag.Title = "用户部门选择";
        diag.URL = Url + "&rdm=" + Math.random();
        diag.OKEvent = callback;    //点击确定后调用的方法
        diag.CancelEvent = callback;
        diag.show();
    }
    function callback(obj) {
        $("#<%=tbxOrgNames.ClientID %>").val(obj.DialogArguments["returnValue2"]);
        $("#<%=hdfOrgIDs.ClientID %>").val(obj.DialogArguments["returnValue"]);
        
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<table class="usertableborder" cellspacing="1" cellpadding="3" align="center" border="0">
    <tr>
        <td class="protablerow3" align="right">账 户：</td>
        <td class="protablerow1" align="left">
            <asp:TextBox ID="userName" runat="server" MaxLength="10"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
            ControlToValidate="userName" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td class="protablerow3" align="right">姓 名：</td>
        <td class="protablerow1" align="left">
            <asp:TextBox ID="name" runat="server" MaxLength="10"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
            ControlToValidate="name" ErrorMessage="RequiredFieldValidator">*</asp:RequiredFieldValidator>
        </td>
    </tr>
        <tr>
        <td class="protablerow3" align="right">所属部门：</td>
        <td class="protablerow1" align="left"><asp:TextBox ID="tbxOrgNames" runat="server" 
                onclick="orgOpen(0);">点击选择</asp:TextBox>
            <asp:HiddenField runat="server" ID="hdfOrgIDs" />
        </td>
    </tr>
    <tr>
        <td class="protablerow3" align="right">默认密码：</td>
        <td class="protablerow1" align="left"><asp:TextBox ID="pwd" runat="server" ReadOnly="True">boms</asp:TextBox>
        </td>
    </tr>
    <tr>
        <td class="protablerow3" align="right">系统角色：</td>
        <td class="protablerow1" align="left"><asp:RadioButtonList ID="RoleList" runat="server"></asp:RadioButtonList></td>
    </tr>
    <tr style="background-color:#d0d8e8">
        <td align="center" colspan="2"><asp:Button ID="add" runat="server" Text="保 存" onclick="add_Click" />
        &nbsp;&nbsp;&nbsp;&nbsp;<input type="reset" value="取 消" onclick="dialogReturn('cancel');" /></td>
    </tr>
</table>
</asp:Content>
